function f(t)
{
    if ((t.getMonth()+1) < 10){
        return '0'+(t.getMonth()+1)
    }
    else{
        return t.getMonth()+1
    }

}
$(document).ready(function() {
    var today = new Date();

    var i = (today.getFullYear()+'-'+(f(today))+'-'+today.getDate());
    $(".span2").val(i);
});